home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / c / tvalt.exe / TESTTXT.CPP < prev    next >
C/C++ Source or Header  |  1992-10-05  |  782b  |  44 lines

  1. #define Uses_TApplication
  2. #define Uses_TMenuBar
  3. #define Uses_TSubMenu
  4. #define Uses_TMenuItem
  5. #define Uses_TKeys
  6. #include <tv.h>
  7.  
  8. extern Boolean useAltWriteMethod;
  9.  
  10. class TMyApp : public TApplication
  11.     {
  12.     public:
  13.         TMyApp();
  14.  
  15.         static TMenuBar *initMenuBar( TRect r );
  16.     };
  17.  
  18. TMyApp::TMyApp() :
  19.         TProgInit( &TMyApp::initStatusLine, &TMyApp::initMenuBar,
  20.                 &TMyApp::initDeskTop )
  21.     {
  22.     }
  23.  
  24. TMenuBar *TMyApp::initMenuBar( TRect r )
  25.     {
  26.     r.b.y = r.a.y+1;
  27.     return new TMenuBar( r,
  28.         *new TSubMenu( "~F~ile", 0 )+
  29.             *new TMenuItem( "E~x~it", cmQuit, kbAltX, hcNoContext, 0 )
  30.         );
  31.     }
  32.  
  33. int main()
  34.     {
  35.     TMyApp app;
  36.  
  37.     useAltWriteMethod = True;
  38.     // Not needed if USEWRITE.OBJ is linked instead of NOWRITE.OBJ.
  39.  
  40.     app.run();
  41.     app.shutDown();
  42.     return 0;
  43.     }
  44.